package com.wp.controller;

import com.wp.pojo.FeedBack;
import com.wp.pojo.PageResult;
import com.wp.pojo.basePojo.SysResult;
import com.wp.service.FeedbackService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/feedback")
@CrossOrigin
public class FeedbackController {
    @Autowired
    private FeedbackService feedbackService;
    /**
     * 获取反馈列表
     * */
    @GetMapping("/getList")
    public SysResult getFeedbackList(PageResult pageResult){
       PageResult pageResults= feedbackService.getFeedbackList(pageResult);
        return SysResult.success(pageResults);
    }
    /**
     * 删除反馈
     */
    @PostMapping("/delete")
    public SysResult deleteFeedbackList(@RequestBody FeedBack feedBack){
        feedbackService.deleteFeedback(feedBack);
        return SysResult.success();
    }
}
